package com.starlink.model.util;

import com.starlink.model.dtomapper.MallPeripheryOrderDetailsDtoMapper;
import com.starlink.model.domain.MallPeripheryOrderDetailsDO;
import com.starlink.model.vo.MallPeripheryOrderDetailsVO;
import com.google.common.collect.Lists;
import org.apache.commons.collections4.CollectionUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * @author zhanghong
 */
public class MallPeripheryOrderDetailsConvert {

    public static List<MallPeripheryOrderDetailsVO> buildMallPeripheryOrderDetailsVoList(List<MallPeripheryOrderDetailsDO> mallPeripheryOrderDetailsDOList) {
        if (CollectionUtils.isEmpty(mallPeripheryOrderDetailsDOList)) {
            return Lists.newArrayList();
        }
        List<MallPeripheryOrderDetailsVO> mallPeripheryOrderDetailsVOList = new ArrayList<>();
        for (MallPeripheryOrderDetailsDO mallPeripheryOrderDetailsDO : mallPeripheryOrderDetailsDOList) {
            mallPeripheryOrderDetailsVOList.add(MallPeripheryOrderDetailsDtoMapper.INSTANCE.do2VO(mallPeripheryOrderDetailsDO));
        }

        return mallPeripheryOrderDetailsVOList;
    }
}
